/*
 * Copyright 2006-2023 ahtelit.com, All Rights Reserved.
 */

package com.telit.firecommand.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * IOT设备推送数据
 *
 * @author yuezhuang
 * @since 2023-04-27
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "IotData", description = "IOT设备推送数据")
public class IotData implements Serializable {

    private static final long serialVersionUID = -1L;

    @ApiModelProperty(value = "ID", required = true)
    private Long id;

    @ApiModelProperty(value = "设备ID", required = true)
    private Long deviceId;

    @ApiModelProperty(value = "设备SN")
    private String sn;

    @ApiModelProperty(value = "数据内容")
    private String data;

    @ApiModelProperty(value = "设备小类")
    private String type;

    @ApiModelProperty(value = "设备大类")
    private String category;

    @ApiModelProperty(value = "消息ID")
    private String msgId;

    @ApiModelProperty(value = "消息时间戳")
    private String timestamp;

    @ApiModelProperty(value = "消息类型，枚举值"
            + "data：设备上行数据消息\n"
            + "event：设备事件消息")
    private String messageType;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

}
